//
//  PywDeleteCacheApi.m
//  PywSdk
//
//  Created by Jade on 16/9/12.
//  Copyright © 2016年 zero. All rights reserved.
//

#import "PywDeleteCacheApi.h"

#import "AIFDeleteCacheManager.h"
#import "PropertyListReformer.h"
#import "PywMBProgressHUD+Pyw.h"


@implementation PywDeleteCacheApi

- (void)requestCheckPayPwdWithUserName:(NSString *)userName
                               success:(Successd)success
                                  fail:(Failure)fail
{
    self.successd = success;
    self.failure = fail;
    
    AIFDeleteCacheManager *manager = [AIFDeleteCacheManager manager];
    manager.username = userName;
    manager.delegate = self;
    [manager loadData];
}

#pragma mark - ETAPIManagerCallBackDelegate
/**
 *  请求成功
 *
 *  @param manager <#manager description#>
 */
- (void)managerCallAPIDidSuccess:(ETApiBaseManager *)manager
{
    PropertyListReformer *reformer = [[PropertyListReformer alloc] init];
    NSDictionary *dict = [manager fetchDataWithReformer:reformer];
    [PywMBProgressHUD hideHUD];
    
}
/**
 *  请求失败
 *
 *  @param manager <#manager description#>
 */
- (void)managerCallApiDidFailed:(ETApiBaseManager *)manager
{
    [PywMBProgressHUD hideHUD];
    if (self.failure) {
        self.failure([self errorWithCode:0]);
    }
}

@end

